package com.safety.hat.data;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * @Author: lijun
 * @Date: 2020/5/25 0:09
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
public class Result<T> implements Serializable {
    /**
     * 指令
     */
    private String cmd;

    /**
     * 状态
     */
    private boolean status;

    /**
     * msg
     */
    private String msg;

    private T data;

    /**
     * 默认消息
     */
    public static Result<Object> defaultResult(ACTEnum actEnum) {
        return Result.builder()
                .cmd(actEnum.getAct())
                .status(Boolean.TRUE)
                .msg("操作成功")
                .data(new Object())
                .build();
    }
}       
    

